/**
 * 公共CSS样式文件
 * 版权声明: 保留发行权和署名权
 * 作者信息: 15058593138@qq.com
 */

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

a {
    color: #1890ff;
    text-decoration: none;
}

a:hover {
    color: #40a9ff;
}

/* 布局 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.header {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.header-title {
    font-size: 18px;
    font-weight: bold;
}

.header-nav {
    display: flex;
    background-color: #f8f8f8;
    border-bottom: 1px solid #eee;
}

.nav-item {
    padding: 10px 20px;
    cursor: pointer;
    position: relative;
}

.nav-item.active {
    color: #1890ff;
    background-color: #e6f7ff;
    border-bottom: 2px solid #1890ff;
}

.nav-item:hover {
    background-color: #f0f0f0;
}

.content {
    padding: 20px 0;
    min-height: calc(100vh - 150px);
}

.footer {
    padding: 15px 0;
    text-align: center;
    background-color: #f8f8f8;
    border-top: 1px solid #e8e8e8;
    color: #999;
    font-size: 12px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: #40a9ff;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.btn {
    display: inline-block;
    padding: 6px;
    background-color: #1890ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    background-color: #40a9ff;
}

.btn-danger {
    background-color: #ff4d4f;
}

.btn-danger:hover {
    background-color: #ff7875;
}

.btn-success {
    background-color: #52c41a;
}

.btn-success:hover {
    background-color: #73d13d;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.table th {
    background-color: #fafafa;
    font-weight: bold;
}

.table tr:hover {
    background-color: #fafafa;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.page-btn {
    padding: 5px 10px;
    margin: 0 5px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
}

.page-btn:hover {
    color: #1890ff;
    border-color: #1890ff;
}

.page-btn.disabled {
    color: #d9d9d9;
    cursor: not-allowed;
}

.page-select {
    margin: 0 5px;
    padding: 5px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
}

/* 遮罩层样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 16px;
    font-weight: bold;
}

.modal-close {
    font-size: 18px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 15px;
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}

.modal-footer {
    padding: 10px 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    background-color: #fff;
}

/* 提示信息样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 4px;
    z-index: 2000;
    max-width: 300px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s, fadeOut 0.3s 2.7s;
    opacity: 0;
}

.toast.success {
    background-color: rgba(82, 196, 26, 0.9);
}

.toast.error {
    background-color: rgba(255, 77, 79, 0.9);
}

.toast.warning {
    background-color: rgba(250, 173, 20, 0.9);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .header-nav {
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .nav-item {
        padding: 10px 15px;
    }
    
    .modal {
        width: 95%;
    }
}

/* 登录页样式 */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
    color: #333;
}

.login-desc {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f6f6f6;
    border-radius: 4px;
    color: #666;
    text-align: center;
}

/* 查询表单样式 */
.search-form {
    display: flex;
    margin-bottom: 20px;
    background-color: #fff;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-input {
    flex: 1;
    margin-right: 10px;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 5px 0;
    min-width: 120px;
    display: none;
    z-index: 100;
}

.dropdown-item {
    display: block;
    padding: 8px 15px;
    color: #333;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

/* 复选框样式 */
.checkbox-wrapper {
    display: inline-block;
    position: relative;
    padding-left: 25px;
    margin-right: 15px;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 3px;
}

.checkbox-wrapper:hover input ~ .checkmark {
    border-color: #1890ff;
}

.checkbox-wrapper input:checked ~ .checkmark {
    background-color: #1890ff;
    border-color: #1890ff;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-wrapper input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-wrapper .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* 选项卡样式 */
.tabs {
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.tab-nav {
    display: flex;
    background-color: #fff;
}

.tab-item {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-item.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
}

.tab-content {
    display: none;
    padding: 20px 0;
}

.tab-content.active {
    display: block;
}
